<!doctype html>
<html lang="zh-CN">

<head>
    <!-- 必须的 meta 标签 -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="Shortcut Icon" href="/static/favicon.ico" type="image/x-icon" />

    <!-- Bootstrap 的 CSS 文件 -->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/index.css">
    <title>Markdown在线编辑器</title>
</head>

<body>
    <div class="container" id="article-data">
        <div class="row">
            <div class="col" id="article-title-div">
                <h1>文章列表</h1>
            </div>
        </div>
        <div class="row publish">
            <div class="col">
                <button type="button" class="btn btn-primary" id="publish-btn">发布文章</button>
            </div>
        </div>
        <div class="row">
            <div class="col" id="article-list-div">
                <script type="text/x-handlebars-template" id="template-article-list">
                    {{#each this}}
                    <div class="row article-list-row">
                        <div class="col article-div" id={{artid}} data-created={{created}}>
                            <a class="article-link" href="/article/{{artid}}">{{title}}</a>
                            <a class="article-del" href="javascript:void(0)" data-artid="{{artid}}"> 删除</a>
                            <a class="article-edt" href="/edit/{{artid}}"> 编辑</a>
                        </div>
                    </div>
                    {{/each}}
                </script>
            </div>
        </div>
        <div class="row page">
            <div class="col">
                <ul class="pagination page-child">
                    <li class="page-item">
                        <a class="page-link" href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                            <span class="sr-only">Previous</span>
                        </a>
                    </li>
                    <li class="page-item"><a class="page-link" href="#">1</a></li>
                    <li class="page-item"><a class="page-link" href="#">2</a></li>
                    <li class="page-item"><a class="page-link" href="#">3</a></li>
                    <li class="page-item">
                        <a class="page-link" href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                            <span class="sr-only">Next</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/handlebars.js"></script>
    <script src="/static/js/index.js"></script>

    <script>
        $(function () {
            GetArticleList(1);
            let page_html = ResetPage(1, 1);
            $(".page-child").html(page_html);
        });
    </script>
</body>

</html>